package com.gome.axwl.aoc.dao;

import com.gome.axwl.aoc.entity.po.ContractPo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;


public interface ContractDao {
    /***
     * 分页查询合同
     * @param contractName
     * @param status
     * @param startTime
     * @param endTime
     * @return
     */
    List<ContractPo> queryContract(@Param("contractName") String contractName,@Param("contractNo") String contractNo,
                                   @Param("carrierPhone")String carrierPhone,@Param("carrierName")String carrierName,
                                   @Param("status")Integer status,
                                   @Param("startTime")Date startTime, @Param("endTime")Date endTime);

    /***
     * 送签后生成合同
     * @param contractPo
     * @return
     */
    int addContract(ContractPo contractPo);

    /***
     * 根据申请单号Id 获取合同
     * @param applyInfoId
     * @return
     */
    ContractPo getByApplyInfoId(@Param("applyInfoId")Integer applyInfoId);


    int sign(@Param("signPerson")String signPerson,@Param("applyInfoId")Integer applyInfoId,@Param("modifyTime")Date modifyTime);

    int pass(@Param("signPerson")String signPerson,@Param("auditStatus")Integer auditStatus,
             @Param("applyInfoId")Integer applyInfoId,@Param("modifyTime")Date modifyTime);

    int unpass(@Param("unpassReason")String unpassReason,@Param("auditStatus")Integer auditStatus,
               @Param("applyInfoId")Integer applyInfoId,@Param("modifyTime")Date modifyTime);

    /**
     * 通过合同编码查询合同
     * @param contractNo
     * @return
     */
    ContractPo queryByContractNo(String contractNo);
}